Fix replacement of keys when prefix is nil
authorJustin Burkett <justin@burkett.cc>
Wed, 15 Mar 2017 17:55:01 +0000 (13:55 -0400)
committerJustin Burkett <justin@burkett.cc>
Wed, 15 Mar 2017 17:55:01 +0000 (13:55 -0400)
The prefix is nil at the top-level keymap

Fixes #163

which-key.el

index e9c2170ebdd4c21cd02ef03b088cda2d64532efb..cc3cc0dc81c10514d3d7ba931319c21a2b392af6 100644 (file)
@@ -1459,7 +1459,10 @@ alists. Returns a list (key separator description)."
       (let* ((key (car key-binding))
              (orig-desc (cdr key-binding))
              (group (which-key--group-p orig-desc))
-             (keys (concat (which-key--current-key-string) " " key))
+             ;; At top-level prefix is nil
+             (keys (if which-key--current-prefix
+                       (concat (which-key--current-key-string) " " key)
+                     key))
              (local (eq (which-key--safe-lookup-key local-map (kbd keys))
                         (intern orig-desc)))
              (hl-face (which-key--highlight-face orig-desc))